import React, { Component } from 'react';
import { ThemeConsumer, UserConsumer } from '../Context';

class ConsumerPage extends Component {
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <div>
        <ThemeConsumer>
          {(themeContext) => (
            <h3 className={themeContext.themeColor}>
              <UserConsumer>
                {(userContext) => (
                  <div>
                    <p className={themeContext.themeColor}>{userContext.name}</p>
                  </div>
                )}
              </UserConsumer>
            </h3>
          )}
        </ThemeConsumer>
      </div>
    );
  }
}

export default ConsumerPage;
